/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Embeddable
public class TbldatosgeneralesPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 12)
    @Column(name = "identificacion")
    private String identificacion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "cod_nom")
    private String codNom;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "cod_com")
    private String codCom;

    public TbldatosgeneralesPK() {
    }

    public TbldatosgeneralesPK(String identificacion, String codNom, String codCom) {
        this.identificacion = identificacion;
        this.codNom = codNom;
        this.codCom = codCom;
    }

    public String getIdentificacion() {
        return identificacion;
    }

    public void setIdentificacion(String identificacion) {
        this.identificacion = identificacion;
    }

    public String getCodNom() {
        return codNom;
    }

    public void setCodNom(String codNom) {
        this.codNom = codNom;
    }

    public String getCodCom() {
        return codCom;
    }

    public void setCodCom(String codCom) {
        this.codCom = codCom;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (identificacion != null ? identificacion.hashCode() : 0);
        hash += (codNom != null ? codNom.hashCode() : 0);
        hash += (codCom != null ? codCom.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbldatosgeneralesPK)) {
            return false;
        }
        TbldatosgeneralesPK other = (TbldatosgeneralesPK) object;
        if ((this.identificacion == null && other.identificacion != null) || (this.identificacion != null && !this.identificacion.equals(other.identificacion))) {
            return false;
        }
        if ((this.codNom == null && other.codNom != null) || (this.codNom != null && !this.codNom.equals(other.codNom))) {
            return false;
        }
        if ((this.codCom == null && other.codCom != null) || (this.codCom != null && !this.codCom.equals(other.codCom))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.com.entidad.TbldatosgeneralesPK[ identificacion=" + identificacion + ", codNom=" + codNom + ", codCom=" + codCom + " ]";
    }
    
}
